package com.mljr.example.ui.laucher;

import android.os.Bundle;
import android.os.Handler;

import com.ctakit.sdk.app.base.BaseActivity;
import com.ctakit.sdk.view.annotation.LayoutContentId;
import com.mljr.example.R;
import com.mljr.example.ui.home.HomeActivity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by lizhenmin on 6/30/16.
 */
@LayoutContentId(R.layout.activity_splash)
public class SplashAcitvity extends BaseActivity{

    int delayMillis = 2000;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        gotoMain();
    }

    private void gotoMain() {

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Map<String, Serializable> data = new HashMap<String, Serializable>();
                data.put("index", 0);
                gotoActivity(HomeActivity.class,data);
//                UIHelper.gotoActivityWithClearTop(getActivity(), Html5Activity.class, data);
                getActivity().overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
                finish();
            }
        }, delayMillis);

    }

    /**
     * 是否需要手势密码
     *
     * @return
     */
    public boolean checkLocked() {
        return false;
    }

    @Override
    public String getPageName() {
        return "SplashAcitvity";
    }
}
